/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cnc;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Timer;
import javax.swing.DefaultComboBoxModel;
import jssc.SerialPortList;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author PiotrGl
 */
public class CncGUI extends javax.swing.JFrame {

    static private DefaultTableModel SPImodel = new DefaultTableModel();
    public CncDevice cncmachine = new CncDevice();
    public GCodeInterpreter interpreter = new GCodeInterpreter(cncmachine);

    /**
     * Creates new form gui
     */
    public CncGUI() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jFileChooserOpenProgram = new javax.swing.JFileChooser();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jProgramPanel = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jProgramArea = new javax.swing.JTextArea();
        jOtworz = new javax.swing.JButton();
        jZapisz = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        jProgramArea1 = new javax.swing.JTextArea();
        jSettingsPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jSettingsButtionConnect = new javax.swing.JButton();
        jSettingsPortsBox = new javax.swing.JComboBox();
        jMovePanel = new javax.swing.JPanel();
        jALLplus = new javax.swing.JButton();
        jALLminus = new javax.swing.JButton();
        jMoveXPanel = new javax.swing.JPanel();
        jXplus = new javax.swing.JButton();
        jXminus = new javax.swing.JButton();
        jXradio = new javax.swing.JRadioButton();
        jXcurrentplus = new javax.swing.JButton();
        jXcurrentminus = new javax.swing.JButton();
        jXcurrent = new javax.swing.JTextField();
        jMoveYPanel = new javax.swing.JPanel();
        jYcurrentplus = new javax.swing.JButton();
        jYcurrentminus = new javax.swing.JButton();
        jYcurrent = new javax.swing.JTextField();
        jYplus = new javax.swing.JButton();
        jYminus = new javax.swing.JButton();
        jYradio = new javax.swing.JRadioButton();
        jMoveZPanel = new javax.swing.JPanel();
        jZcurrentplus = new javax.swing.JButton();
        jZcurrentminus = new javax.swing.JButton();
        jZcurrent = new javax.swing.JTextField();
        jZplus = new javax.swing.JButton();
        jZminus = new javax.swing.JButton();
        jZradio = new javax.swing.JRadioButton();
        jMoveLaserPanel = new javax.swing.JPanel();
        jLaserCurrentplus = new javax.swing.JButton();
        jLasercurrentminus = new javax.swing.JButton();
        jLaserCurrent = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jAradio = new javax.swing.JRadioButton();
        jAllRadio = new javax.swing.JRadioButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jLogText = new javax.swing.JTextPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jProgramArea.setColumns(20);
        jProgramArea.setRows(5);
        jProgramArea.setText("N40 G00 X0 Z5\n");
        jScrollPane2.setViewportView(jProgramArea);

        jOtworz.setText("Otworz");
        jOtworz.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jOtworzActionPerformed(evt);
            }
        });

        jZapisz.setText("Zapisz");
        jZapisz.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jZapiszActionPerformed(evt);
            }
        });

        jButton1.setText("jButton1");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("start");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("stop");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jProgramArea1.setColumns(20);
        jProgramArea1.setRows(5);
        jProgramArea1.setText("N40 G00 X0 Z5\n//N50 G01 Z0 F0.5 X+50\n//N60 G01 X80 F0.2\n//N70 G02 X100 Z-30 I50 K0\n//N80 G01 Z-120 X+20\n//N90 G00 X200 Z200");
        jScrollPane3.setViewportView(jProgramArea1);

        javax.swing.GroupLayout jProgramPanelLayout = new javax.swing.GroupLayout(jProgramPanel);
        jProgramPanel.setLayout(jProgramPanelLayout);
        jProgramPanelLayout.setHorizontalGroup(
            jProgramPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jProgramPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jProgramPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jProgramPanelLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 399, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jProgramPanelLayout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 399, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 59, Short.MAX_VALUE)
                        .addGroup(jProgramPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jProgramPanelLayout.createSequentialGroup()
                                .addComponent(jOtworz)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jZapisz))
                            .addComponent(jButton1)
                            .addComponent(jButton2)
                            .addComponent(jButton3))
                        .addContainerGap())))
        );
        jProgramPanelLayout.setVerticalGroup(
            jProgramPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jProgramPanelLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jProgramPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jProgramPanelLayout.createSequentialGroup()
                        .addGroup(jProgramPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jOtworz)
                            .addComponent(jZapisz))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1)
                        .addGap(18, 18, 18)
                        .addComponent(jButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton3))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(25, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("PROGRAM", jProgramPanel);

        jLabel1.setText("Port:");

        jSettingsButtionConnect.setText("CONNECT");
        jSettingsButtionConnect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jSettingsButtionConnectActionPerformed(evt);
            }
        });

        jSettingsPortsBox.setEditable(true);
        jSettingsPortsBox.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
                jSettingsPortsBoxPopupMenuWillBecomeVisible(evt);
            }
        });

        javax.swing.GroupLayout jSettingsPanelLayout = new javax.swing.GroupLayout(jSettingsPanel);
        jSettingsPanel.setLayout(jSettingsPanelLayout);
        jSettingsPanelLayout.setHorizontalGroup(
            jSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jSettingsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSettingsPortsBox, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSettingsButtionConnect)
                .addContainerGap(377, Short.MAX_VALUE))
        );
        jSettingsPanelLayout.setVerticalGroup(
            jSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jSettingsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jSettingsButtionConnect)
                        .addComponent(jSettingsPortsBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jSettingsPanelLayout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(jLabel1)))
                .addContainerGap(416, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("SETTINGS", jSettingsPanel);

        jALLplus.setText("ALL+");
        jALLplus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jALLplusActionPerformed(evt);
            }
        });

        jALLminus.setText("ALL-");
        jALLminus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jALLminusActionPerformed(evt);
            }
        });

        jMoveXPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        jXplus.setText("X+");
        jXplus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jXplusActionPerformed(evt);
            }
        });

        jXminus.setText("X-");
        jXminus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jXminusActionPerformed(evt);
            }
        });

        jXradio.setSelected(true);
        jXradio.setText("ON");
        jXradio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jXradioActionPerformed(evt);
            }
        });

        jXcurrentplus.setText("+");
        jXcurrentplus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jXcurrentplusActionPerformed(evt);
            }
        });

        jXcurrentminus.setText("-");
        jXcurrentminus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jXcurrentminusActionPerformed(evt);
            }
        });

        jXcurrent.setText("123");
        jXcurrent.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));

        javax.swing.GroupLayout jMoveXPanelLayout = new javax.swing.GroupLayout(jMoveXPanel);
        jMoveXPanel.setLayout(jMoveXPanelLayout);
        jMoveXPanelLayout.setHorizontalGroup(
            jMoveXPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMoveXPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jMoveXPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jXradio)
                    .addComponent(jXplus)
                    .addComponent(jXminus)
                    .addGroup(jMoveXPanelLayout.createSequentialGroup()
                        .addComponent(jXcurrentplus)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jXcurrentminus))
                    .addComponent(jXcurrent, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(42, Short.MAX_VALUE))
        );
        jMoveXPanelLayout.setVerticalGroup(
            jMoveXPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMoveXPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jXplus)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jXminus)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jXradio)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jMoveXPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jXcurrentplus)
                    .addComponent(jXcurrentminus))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jXcurrent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(52, Short.MAX_VALUE))
        );

        jMoveYPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        jYcurrentplus.setText("+");
        jYcurrentplus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jYcurrentplusActionPerformed(evt);
            }
        });

        jYcurrentminus.setText("-");
        jYcurrentminus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jYcurrentminusActionPerformed(evt);
            }
        });

        jYcurrent.setText("123");
        jYcurrent.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));

        jYplus.setText("Y+");
        jYplus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jYplusActionPerformed(evt);
            }
        });

        jYminus.setText("Y-");
        jYminus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jYminusActionPerformed(evt);
            }
        });

        jYradio.setSelected(true);
        jYradio.setText("ON");
        jYradio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jYradioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jMoveYPanelLayout = new javax.swing.GroupLayout(jMoveYPanel);
        jMoveYPanel.setLayout(jMoveYPanelLayout);
        jMoveYPanelLayout.setHorizontalGroup(
            jMoveYPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMoveYPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jMoveYPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jYradio)
                    .addGroup(jMoveYPanelLayout.createSequentialGroup()
                        .addComponent(jYcurrentplus)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jYcurrentminus))
                    .addComponent(jYcurrent, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jYplus)
                    .addComponent(jYminus))
                .addContainerGap(42, Short.MAX_VALUE))
        );
        jMoveYPanelLayout.setVerticalGroup(
            jMoveYPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMoveYPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jYplus)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jYminus)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jYradio)
                .addGap(7, 7, 7)
                .addGroup(jMoveYPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jYcurrentplus)
                    .addComponent(jYcurrentminus))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jYcurrent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(52, Short.MAX_VALUE))
        );

        jMoveZPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        jZcurrentplus.setText("+");
        jZcurrentplus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jZcurrentplusActionPerformed(evt);
            }
        });

        jZcurrentminus.setText("-");
        jZcurrentminus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jZcurrentminusActionPerformed(evt);
            }
        });

        jZcurrent.setText("123");
        jZcurrent.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));

        jZplus.setText("Z+");
        jZplus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jZplusActionPerformed(evt);
            }
        });

        jZminus.setText("Z-");
        jZminus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jZminusActionPerformed(evt);
            }
        });

        jZradio.setSelected(true);
        jZradio.setText("ON");
        jZradio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jZradioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jMoveZPanelLayout = new javax.swing.GroupLayout(jMoveZPanel);
        jMoveZPanel.setLayout(jMoveZPanelLayout);
        jMoveZPanelLayout.setHorizontalGroup(
            jMoveZPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMoveZPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jMoveZPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jZradio)
                    .addGroup(jMoveZPanelLayout.createSequentialGroup()
                        .addComponent(jZcurrentplus)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jZcurrentminus))
                    .addComponent(jZcurrent, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jZplus)
                    .addComponent(jZminus))
                .addContainerGap(42, Short.MAX_VALUE))
        );
        jMoveZPanelLayout.setVerticalGroup(
            jMoveZPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMoveZPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jZplus)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jZminus)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jZradio)
                .addGap(7, 7, 7)
                .addGroup(jMoveZPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jZcurrentplus)
                    .addComponent(jZcurrentminus))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jZcurrent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(52, Short.MAX_VALUE))
        );

        jMoveLaserPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        jLaserCurrentplus.setText("+");
        jLaserCurrentplus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jLaserCurrentplusActionPerformed(evt);
            }
        });

        jLasercurrentminus.setText("-");
        jLasercurrentminus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jLasercurrentminusActionPerformed(evt);
            }
        });

        jLaserCurrent.setText("123");
        jLaserCurrent.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));

        jLabel2.setText("LASER:");

        jAradio.setSelected(true);
        jAradio.setText("ON");
        jAradio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAradioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jMoveLaserPanelLayout = new javax.swing.GroupLayout(jMoveLaserPanel);
        jMoveLaserPanel.setLayout(jMoveLaserPanelLayout);
        jMoveLaserPanelLayout.setHorizontalGroup(
            jMoveLaserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMoveLaserPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jMoveLaserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jMoveLaserPanelLayout.createSequentialGroup()
                        .addComponent(jLaserCurrentplus)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLasercurrentminus))
                    .addComponent(jLaserCurrent, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jAradio))
                .addContainerGap(42, Short.MAX_VALUE))
        );
        jMoveLaserPanelLayout.setVerticalGroup(
            jMoveLaserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMoveLaserPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jAradio)
                .addGap(40, 40, 40)
                .addGroup(jMoveLaserPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLaserCurrentplus)
                    .addComponent(jLasercurrentminus))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLaserCurrent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jAllRadio.setSelected(true);
        jAllRadio.setText("ON");
        jAllRadio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAllRadioActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jMovePanelLayout = new javax.swing.GroupLayout(jMovePanel);
        jMovePanel.setLayout(jMovePanelLayout);
        jMovePanelLayout.setHorizontalGroup(
            jMovePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMovePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jMovePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jMovePanelLayout.createSequentialGroup()
                        .addComponent(jAllRadio)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jMovePanelLayout.createSequentialGroup()
                        .addGroup(jMovePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jMovePanelLayout.createSequentialGroup()
                                .addComponent(jMoveXPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                                .addComponent(jMoveYPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jALLplus)
                            .addComponent(jALLminus))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jMoveZPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jMoveLaserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(20, Short.MAX_VALUE))))
        );
        jMovePanelLayout.setVerticalGroup(
            jMovePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jMovePanelLayout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(jMovePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jMovePanelLayout.createSequentialGroup()
                        .addGroup(jMovePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jMoveXPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jMoveYPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jALLplus)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jALLminus))
                    .addGroup(jMovePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jMoveLaserPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jMoveZPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jAllRadio)
                .addContainerGap(129, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("MOVE", jMovePanel);

        jLogText.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jLogText.setText("Hello World");
        jLogText.setEnabled(false);
        jScrollPane1.setViewportView(jLogText);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
            .addComponent(jScrollPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        if (cncmachine.getPort() != null) {
            cncmachine.Disconnect();
        }
    }//GEN-LAST:event_formWindowClosing

    private void jSettingsPortsBoxPopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_jSettingsPortsBoxPopupMenuWillBecomeVisible
        String[] portNames = SerialPortList.getPortNames();
        //for(int i = 0; i < portNames.length; i++){
        jSettingsPortsBox.setModel(new DefaultComboBoxModel(portNames));
        //    System.out.println(portNames[i]);
        //}
    }//GEN-LAST:event_jSettingsPortsBoxPopupMenuWillBecomeVisible

    private void jSettingsButtionConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSettingsButtionConnectActionPerformed
        if (cncmachine.getPort() != null) {
            if (cncmachine.Disconnect() == 0) {
                jLogText.setText("Disconected");
                jSettingsButtionConnect.setText("CONNECT");
            } else {
                jLogText.setText("Error");
            }
        } else {
            if (cncmachine.Connect(jSettingsPortsBox.getSelectedItem().toString()) == 0) {
                jLogText.setText("Connected");
                jSettingsButtionConnect.setText("DISCONNECT");
            } else {
                jLogText.setText("Error");
            }
        }
    }//GEN-LAST:event_jSettingsButtionConnectActionPerformed

    private void jXplusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jXplusActionPerformed
        move ruchp = new move(true, true);
        move stop = new move(false, false);
        cncmachine.move(ruchp, stop, stop);
    }//GEN-LAST:event_jXplusActionPerformed

    private void jXminusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jXminusActionPerformed
        move ruchm = new move(false, true);
        move stop = new move(false, false);
        cncmachine.move(ruchm, stop, stop);
    }//GEN-LAST:event_jXminusActionPerformed

    private void jYplusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jYplusActionPerformed
        move ruchp = new move(true, true);
        move stop = new move(false, false);
        cncmachine.move(stop, ruchp, stop);
    }//GEN-LAST:event_jYplusActionPerformed

    private void jYminusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jYminusActionPerformed
        move ruchm = new move(false, true);
        move stop = new move(false, false);
        cncmachine.move(stop, ruchm, stop);
    }//GEN-LAST:event_jYminusActionPerformed

    private void jZplusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jZplusActionPerformed
        move ruchp = new move(true, true);
        move stop = new move(false, false);
        cncmachine.move(stop, stop, ruchp);
    }//GEN-LAST:event_jZplusActionPerformed

    private void jZminusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jZminusActionPerformed
        move ruchm = new move(false, true);
        move stop = new move(false, false);
        cncmachine.move(stop, stop, ruchm);
    }//GEN-LAST:event_jZminusActionPerformed

    private void jALLplusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jALLplusActionPerformed
        move ruchp = new move(true, true);
        cncmachine.move(ruchp, ruchp, ruchp);
    }//GEN-LAST:event_jALLplusActionPerformed

    private void jALLminusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jALLminusActionPerformed
        move ruchm = new move(false, true);
        cncmachine.move(ruchm, ruchm, ruchm);
    }//GEN-LAST:event_jALLminusActionPerformed

    private void jXradioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jXradioActionPerformed
        if (jXradio.isSelected()) {
            jXradio.setText("ON");
            cncmachine.command(0x02, CncDevice.command_on, 0x00);
        } else {
            jXradio.setText("OFF");
            cncmachine.command(0x02, CncDevice.command_off, 0x00);
        }
    }//GEN-LAST:event_jXradioActionPerformed

    private void jYradioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jYradioActionPerformed
        if (jYradio.isSelected()) {
            jYradio.setText("ON");
            cncmachine.command(0x04, CncDevice.command_on, 0x00);
        } else {
            jYradio.setText("OFF");
            cncmachine.command(0x04, CncDevice.command_off, 0x00);
        }
    }//GEN-LAST:event_jYradioActionPerformed

    private void jZradioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jZradioActionPerformed
        if (jZradio.isSelected()) {
            jXradio.setText("ON");
            cncmachine.command(0x08, CncDevice.command_on, 0x00);
        } else {
            jZradio.setText("OFF");
            cncmachine.command(0x08, CncDevice.command_off, 0x00);
        }
    }//GEN-LAST:event_jZradioActionPerformed

    private void jAradioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAradioActionPerformed
        if (jAradio.isSelected()) {
            jAradio.setText("ON");
            cncmachine.command(0x01, CncDevice.command_on, 0x00);
        } else {
            jAradio.setText("OFF");
            cncmachine.command(0x01, CncDevice.command_off, 0x00);
        }
    }//GEN-LAST:event_jAradioActionPerformed

    private void jXcurrentplusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jXcurrentplusActionPerformed
        try {
            int current = Integer.valueOf(jXcurrent.getText(), 16);
            current++;
            jXcurrent.setText(Integer.toString(current, 16));
            cncmachine.command(0x02, CncDevice.command_set_curent, current);
        } catch (Exception ex) {
            System.out.println(ex);
        }

    }//GEN-LAST:event_jXcurrentplusActionPerformed

    private void jXcurrentminusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jXcurrentminusActionPerformed
        try {
            int current = Integer.valueOf(jXcurrent.getText(), 16);
            current--;
            jXcurrent.setText(Integer.toString(current, 16));
            cncmachine.command(0x02, CncDevice.command_set_curent, current);
        } catch (Exception ex) {
            System.out.println(ex);
        }
    }//GEN-LAST:event_jXcurrentminusActionPerformed

    private void jOtworzActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jOtworzActionPerformed
        int odpowiedz = jFileChooserOpenProgram.showOpenDialog(this);
        if (odpowiedz == jFileChooserOpenProgram.APPROVE_OPTION) {
            File file = jFileChooserOpenProgram.getSelectedFile();
            try {
                jProgramArea.read(new FileReader(file.getAbsolutePath()), null);
            } catch (IOException e) {
                System.out.println("Nie mogę otworzyć pliku: " + file.getAbsolutePath());
                System.out.println("Problem: " + e);
            }
        }

    }//GEN-LAST:event_jOtworzActionPerformed

    private void jZapiszActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jZapiszActionPerformed
        int odpowiedz = jFileChooserOpenProgram.showSaveDialog(this);
        if (odpowiedz == jFileChooserOpenProgram.APPROVE_OPTION) {
            File file = jFileChooserOpenProgram.getSelectedFile();
            try {
                FileWriter out = new FileWriter(file);
                out.write(jProgramArea.getText());
                out.close();
            } catch (IOException e) {
                System.out.println("Nie mogę zapisać pliku: " + file.getAbsolutePath());
                System.out.println("Problem: " + e);
            }
        }

    }//GEN-LAST:event_jZapiszActionPerformed

    private void jYcurrentplusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jYcurrentplusActionPerformed
        try {
            int current = Integer.valueOf(jYcurrent.getText(), 16);
            current++;
            jYcurrent.setText(Integer.toString(current, 16));
            cncmachine.command(0x04, CncDevice.command_set_curent, current);
        } catch (Exception ex) {
            System.out.println(ex);
        }
    }//GEN-LAST:event_jYcurrentplusActionPerformed

    private void jYcurrentminusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jYcurrentminusActionPerformed
        try {
            int current = Integer.valueOf(jYcurrent.getText(), 16);
            current--;
            jYcurrent.setText(Integer.toString(current, 16));
            cncmachine.command(0x04, CncDevice.command_set_curent, current);
        } catch (Exception ex) {
            System.out.println(ex);
        }
    }//GEN-LAST:event_jYcurrentminusActionPerformed

    private void jZcurrentplusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jZcurrentplusActionPerformed
        try {
            int current = Integer.valueOf(jZcurrent.getText(), 16);
            current++;
            jZcurrent.setText(Integer.toString(current, 16));
            cncmachine.command(0x08, CncDevice.command_set_curent, current);
        } catch (Exception ex) {
            System.out.println(ex);
        }
    }//GEN-LAST:event_jZcurrentplusActionPerformed

    private void jZcurrentminusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jZcurrentminusActionPerformed
        try {
            int current = Integer.valueOf(jZcurrent.getText(), 16);
            current--;
            jZcurrent.setText(Integer.toString(current, 16));
            cncmachine.command(0x08, CncDevice.command_set_curent, current);
        } catch (Exception ex) {
            System.out.println(ex);
        }
    }//GEN-LAST:event_jZcurrentminusActionPerformed

    private void jLaserCurrentplusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jLaserCurrentplusActionPerformed
        try {
            int current = Integer.valueOf(jLaserCurrent.getText(), 16);
            current++;
            jLaserCurrent.setText(Integer.toString(current, 16));
            cncmachine.command(0x01, CncDevice.command_set_curent, current);
        } catch (Exception ex) {
            System.out.println(ex);
        }
    }//GEN-LAST:event_jLaserCurrentplusActionPerformed

    private void jLasercurrentminusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jLasercurrentminusActionPerformed
        try {
            int current = Integer.valueOf(jLaserCurrent.getText(), 16);
            current--;
            jLaserCurrent.setText(Integer.toString(current, 16));
            cncmachine.command(0x01, CncDevice.command_set_curent, current);
        } catch (Exception ex) {
            System.out.println(ex);
        }
    }//GEN-LAST:event_jLasercurrentminusActionPerformed

    private void jAllRadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAllRadioActionPerformed
        if (jAllRadio.isSelected()) {
            jAllRadio.setText("ON");
            cncmachine.command(0x0F, CncDevice.command_on, 0x00);
        } else {
            jAllRadio.setText("OFF");
            cncmachine.command(0x0F, CncDevice.command_off, 0x00);
        }
    }//GEN-LAST:event_jAllRadioActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        String regexp = "[A-Za-z][\\+-]?[0-9]+([\\.,]?[0-9]+|[0-9]*)";
        HashMap<String, Float> komendy = new HashMap();
        
        String tekst = jProgramArea.getText();
        tekst = tekst.replace(",", ".");
        //TODO: float nie parsuje przecinków
        String linie[] = tekst.split("\n");
        for (String x : linie) {
            String podzial[] = x.split(" ");
            System.out.println("linia");
            for (String z : podzial) {
                float parametr = (float) 0;
                if (z.matches(regexp)) {
                    if (z.contains("+") || z.contains("-")){
                        switch (z.charAt(0)  ) {
                            case 'X':
                            case 'x':    
                                parametr = Float.parseFloat(z.substring(1))+interpreter.getCurrent().getXf();
                                break;
                            case 'Y':
                            case 'y':    
                                parametr = Float.parseFloat(z.substring(1))+interpreter.getCurrent().getYf();
                                break;   
                            case 'Z':
                            case 'z':    
                                parametr = Float.parseFloat(z.substring(1))+interpreter.getCurrent().getZf();
                                break;
                                    
                        }
                    } else {
                        parametr = Float.parseFloat(z.substring(1));
                    }
                    komendy.put(z.substring(0, 1), parametr);

                }
            }
            interpreter.interprate(komendy);
        }

    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed

        Timer timer = new Timer();

        //GCodeInterpreter interpreter = new GCodeInterpreter();

        timer.schedule(interpreter, 500, 500);



    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        interpreter.cancel();

    }//GEN-LAST:event_jButton3ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(CncGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(CncGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(CncGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(CncGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //initialization table
        SPImodel.addColumn("Czas");
        SPImodel.addColumn("Adres");
        SPImodel.addColumn("Dane");
        SPImodel.addColumn("Opis");
        //jTable1.setModel(SPImodel);


        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new CncGUI().setVisible(true);
            }
        });
        while (true) {
            //System.out.println(interpreter.getTimer());
        }
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jALLminus;
    private javax.swing.JButton jALLplus;
    private javax.swing.JRadioButton jAllRadio;
    private javax.swing.JRadioButton jAradio;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JFileChooser jFileChooserOpenProgram;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JTextField jLaserCurrent;
    private javax.swing.JButton jLaserCurrentplus;
    private javax.swing.JButton jLasercurrentminus;
    private javax.swing.JTextPane jLogText;
    private javax.swing.JPanel jMoveLaserPanel;
    private javax.swing.JPanel jMovePanel;
    private javax.swing.JPanel jMoveXPanel;
    private javax.swing.JPanel jMoveYPanel;
    private javax.swing.JPanel jMoveZPanel;
    private javax.swing.JButton jOtworz;
    private javax.swing.JTextArea jProgramArea;
    private javax.swing.JTextArea jProgramArea1;
    private javax.swing.JPanel jProgramPanel;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JButton jSettingsButtionConnect;
    private javax.swing.JPanel jSettingsPanel;
    private javax.swing.JComboBox jSettingsPortsBox;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField jXcurrent;
    private javax.swing.JButton jXcurrentminus;
    private javax.swing.JButton jXcurrentplus;
    private javax.swing.JButton jXminus;
    private javax.swing.JButton jXplus;
    private javax.swing.JRadioButton jXradio;
    private javax.swing.JTextField jYcurrent;
    private javax.swing.JButton jYcurrentminus;
    private javax.swing.JButton jYcurrentplus;
    private javax.swing.JButton jYminus;
    private javax.swing.JButton jYplus;
    private javax.swing.JRadioButton jYradio;
    private javax.swing.JButton jZapisz;
    private javax.swing.JTextField jZcurrent;
    private javax.swing.JButton jZcurrentminus;
    private javax.swing.JButton jZcurrentplus;
    private javax.swing.JButton jZminus;
    private javax.swing.JButton jZplus;
    private javax.swing.JRadioButton jZradio;
    // End of variables declaration//GEN-END:variables
}
